home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-9.10-netbook-remix-PL.iso / casper / filesystem.squashfs / usr / share / gtksourceview-2.0 / language-specs / prolog.lang < prev    next >
Extensible Markup Language  |  2009-10-02  |  7KB  |  221 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3.  
  4.  Authors: Ignacio Casal Quinteiro
  5.  Copyright (C) 2009 Ignacio Casal Quinteiro <icq@gnome.org>
  6.  
  7.  This library is free software; you can redistribute it and/or
  8.  modify it under the terms of the GNU Library General Public
  9.  License as published by the Free Software Foundation; either
  10.  version 2 of the License, or (at your option) any later version.
  11.  
  12.  This library is distributed in the hope that it will be useful,
  13.  but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15.  Library General Public License for more details.
  16.  
  17.  You should have received a copy of the GNU Library General Public
  18.  License along with this library; if not, write to the
  19.  Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  20.  Boston, MA 02111-1307, USA.
  21.  
  22. -->
  23. <language id="prolog" _name="Prolog" version="2.0" _section="Sources">
  24.   <metadata>
  25.     <property name="mimetypes">text/x-prolog</property>
  26.     <property name="globs">*.prolog</property>
  27.   </metadata>
  28.  
  29.   <styles>
  30.     <style id="comment"      _name="Comment"      map-to="def:comment"/>
  31.     <style id="variable"     _name="Variable"     map-to="def:type"/>
  32.     <style id="keyword"      _name="Keyword"      map-to="def:keyword"/>
  33.     <style id="string"       _name="String"       map-to="def:string"/>
  34.     <style id="number"       _name="Number"       map-to="def:decimal"/>
  35.     <style id="operator"     _name="Operator"     map-to="def:operator"/>
  36.     <style id="error"        _name="Error"        map-to="def:error"/>
  37.   </styles>
  38.  
  39.   <definitions>
  40.     
  41.     <define-regex id="symbolchar">[-!+\\|=:&><]</define-regex>
  42.     
  43.     <context id="line-comment" style-ref="comment" end-at-line-end="true">
  44.       <start>%</start>
  45.       <include>
  46.         <context ref="def:in-comment"/>
  47.       </include>
  48.     </context>
  49.  
  50.     <context id="block-comment" style-ref="comment">
  51.       <start>/\*</start>
  52.       <end>\*/</end>
  53.       <include>
  54.         <context ref="def:in-comment"/>
  55.       </include>
  56.     </context>
  57.     
  58.     <context id="close-comment-outside-comment" style-ref="error">
  59.       <match>\*/(?!\*)</match>
  60.     </context>
  61.  
  62.     <context id="variable" style-ref="variable">
  63.       <match>(_|[A-Z][A-Za-z0-9_]*)</match>
  64.     </context>
  65.     
  66.     <context id="operators" style-ref="operator">
  67.       <prefix>(?<!\%{symbolchar})</prefix>
  68.       <suffix>(?!\%{symbolchar})</suffix>
  69.       <keyword>=</keyword>
  70.       <keyword>==</keyword>
  71.       <keyword>=\\=</keyword>
  72.       <keyword>=:=</keyword>
  73.       <keyword>\|</keyword>
  74.       <keyword><</keyword>
  75.       <keyword>></keyword>
  76.       <keyword>=<</keyword>
  77.       <keyword>>=</keyword>
  78.       <keyword>\\=</keyword>
  79.       <keyword>\\==</keyword>
  80.       <keyword>\\\+</keyword>
  81.     </context>
  82.     
  83.     <context id="special-operators" style-ref="operator">
  84.       <match>([!;]|:\-)</match>
  85.     </context>
  86.  
  87.     <context id="string" style-ref="string" end-at-line-end="true">
  88.       <start>"</start>
  89.       <end>"</end>
  90.     </context>
  91.  
  92.     <context id="string2" style-ref="string" end-at-line-end="true">
  93.       <start>'</start>
  94.       <end>'</end>
  95.     </context>
  96.  
  97.     <context id="number" style-ref="number">
  98.       <match extended="true">
  99.         \b[0-9]+(\.[0-9]+)?\b
  100.       </match>
  101.     </context>
  102.  
  103.     <context id="arith" style-ref="keyword">
  104.       <keyword>mod</keyword>
  105.       <keyword>div</keyword>
  106.       <keyword>abs</keyword>
  107.       <keyword>exp</keyword>
  108.       <keyword>ln</keyword>
  109.       <keyword>log</keyword>
  110.       <keyword>sqrt</keyword>
  111.       <keyword>round</keyword>
  112.       <keyword>trunc</keyword>
  113.       <keyword>val</keyword>
  114.       <keyword>cos</keyword>
  115.       <keyword>sin</keyword>
  116.       <keyword>tan</keyword>
  117.       <keyword>arctan</keyword>
  118.       <keyword>random</keyword>
  119.       <keyword>randominit</keyword>
  120.     </context>
  121.  
  122.     <context id="keyword" style-ref="keyword">
  123.       <keyword>module</keyword>
  124.       <keyword>meta_predicate</keyword>
  125.       <keyword>multifile</keyword>
  126.       <keyword>dynamic</keyword>
  127.       <keyword>abolish</keyword>
  128.       <keyword>current_output</keyword>
  129.       <keyword>peek_code</keyword>
  130.       <keyword>append</keyword>
  131.       <keyword>current_predicate</keyword>
  132.       <keyword>put_byte</keyword>
  133.       <keyword>arg</keyword>
  134.       <keyword>current_prolog_flag</keyword>
  135.       <keyword>put_char</keyword>
  136.       <keyword>asserta</keyword>
  137.       <keyword>assert</keyword>
  138.       <keyword>fail</keyword>
  139.       <keyword>put_code</keyword>
  140.       <keyword>assertz</keyword>
  141.       <keyword>findall</keyword>
  142.       <keyword>read</keyword>
  143.       <keyword>at_end_of_stream</keyword>
  144.       <keyword>float</keyword>
  145.       <keyword>read_term</keyword>
  146.       <keyword>atom</keyword>
  147.       <keyword>flush_output</keyword>
  148.       <keyword>repeat</keyword>
  149.       <keyword>atom_chars</keyword>
  150.       <keyword>functor</keyword>
  151.       <keyword>retract</keyword>
  152.       <keyword>atom_codes</keyword>
  153.       <keyword>get_byte</keyword>
  154.       <keyword>set_input</keyword>
  155.       <keyword>atom_concat</keyword>
  156.       <keyword>get_char</keyword>
  157.       <keyword>set_output</keyword>
  158.       <keyword>atom_length</keyword>
  159.       <keyword>get_code</keyword>
  160.       <keyword>set_prolog_flag</keyword>
  161.       <keyword>atomic</keyword>
  162.       <keyword>halt</keyword>
  163.       <keyword>set_stream_position</keyword>
  164.       <keyword>bagof</keyword>
  165.       <keyword>integer</keyword>
  166.       <keyword>setof</keyword>
  167.       <keyword>call</keyword>
  168.       <keyword>is</keyword>
  169.       <keyword>stream_property</keyword>
  170.       <keyword>catch</keyword>
  171.       <keyword>nl</keyword>
  172.       <keyword>sub_atom</keyword>
  173.       <keyword>char_code</keyword>
  174.       <keyword>nonvar</keyword>
  175.       <keyword>throw</keyword>
  176.       <keyword>char_conversion</keyword>
  177.       <keyword>number</keyword>
  178.       <keyword>clause</keyword>
  179.       <keyword>number_chars</keyword>
  180.       <keyword>unify_with_occurs_check</keyword>
  181.       <keyword>close</keyword>
  182.       <keyword>number_codes</keyword>
  183.       <keyword>var</keyword>
  184.       <keyword>compound</keyword>
  185.       <keyword>once</keyword>
  186.       <keyword>copy_term</keyword>
  187.       <keyword>op</keyword>
  188.       <keyword>write</keyword>
  189.       <keyword>write_canonical</keyword>
  190.       <keyword>write_term</keyword>
  191.       <keyword>writeq</keyword>
  192.       <keyword>current_char_conversion</keyword>
  193.       <keyword>open</keyword>
  194.       <keyword>current_input</keyword>
  195.       <keyword>peek_byte</keyword>
  196.       <keyword>current_op</keyword>
  197.       <keyword>peek_char</keyword>
  198.       <keyword>false</keyword>
  199.       <keyword>true</keyword>
  200.       <keyword>consult</keyword>
  201.     </context>
  202.  
  203.     <context id="prolog">
  204.       <include>
  205.         <context ref="keyword"/>
  206.         <context ref="arith"/>
  207.         <context ref="number"/>
  208.         <context ref="string"/>
  209.         <context ref="string2"/>
  210.         <context ref="special-operators"/>
  211.         <context ref="operators"/>
  212.         <context ref="variable"/>
  213.         <context ref="block-comment"/>
  214.         <context ref="line-comment"/>
  215.         <context ref="close-comment-outside-comment"/>
  216.       </include>
  217.     </context>
  218.  
  219.   </definitions>
  220. </language>
  221.